pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let mut add = 0;
    let mut base = 0;
    let mut base_id = 0;

    //读取原始数字并存储到add中为十进制
    for (i, e) in num_str.char_indices() {
        if e != '(' {
            match e.to_digit(10) {
                Some(digit) => add = add * 10 + digit,
                None => println!("The character is not a digit"),
            }
        } else {
            base_id = i + 1;
            break;
        }
    }

    //读取原始进制数
    for (i, e) in num_str.char_indices() {
        if i < base_id {
            continue;
        } else if e != ')' {
            match e.to_digit(10) {
                Some(digit) => base = base * 10 + digit,
                None => println!("The character is not a digit"),
            }
        } else {
            break;
        }
    }

    //将add数字转为十进制表示，放到num_ten中
    let mut num_ten = 0;
    let mut index = 0;
    while add > 0 {
        let temp = add % 10 * base.pow(index);
        num_ten += temp;
        index += 1;
        add /= 10;
    }

    //将num_ten转换为目标进制并按存储在字符向量中，注意高低位的含义
    let mut ret: Vec<char> = Vec::new();
    while num_ten > 0 {
        let tmp = num_ten % to_base;
        let digit_char = if tmp < 10 {
            char::from_digit(tmp, 10).unwrap()
        } else {
            (b'a' + (tmp - 10) as u8) as char
        };
        ret.push(digit_char);
        num_ten /= to_base;
    }

    //反转字符向量并组合
    ret.reverse();
    ret.into_iter().collect()
}